#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QAction>
#include <QCloseEvent>
#include <QMainWindow>
#include <QMdiSubWindow>
#include <QSignalMapper>
#include "mdichild.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_actionNew_triggered();
	void updateMenus();
	MdiChild *createMdiChild();
	void mapped(QWidget * wid);


	void on_actionOpen_triggered();

	void on_actionSave_triggered();

	void on_actionSaveAs_triggered();

	void on_actionExit_triggered();

	void on_actionUndo_triggered();

	void on_actionRedo_triggered();

	void on_actionCut_triggered();

	void on_actionCopy_triggered();

	void on_actionPaste_triggered();

	void on_actionClose_triggered();

	void on_actionCloseAll_triggered();

	void on_actionTile_triggered();

	void on_actionCascade_triggered();

	void on_actionNext_triggered();

	void on_actionPrevious_triggered();

	void on_actionAboutQt_triggered();

	void on_actionAbout_triggered();

private:
	MdiChild *activeMdiChild();
	QMdiSubWindow * findMdiChild(QString &fileName);
	void updateWindowMenus();
	void readSettings();
	void saveSettings();


private:
    Ui::MainWindow *ui;
	QAction *actionSeparator;
	QSignalMapper *windowManager;



	// QWidget interface
protected:
	void closeEvent(QCloseEvent *event) override;
};

#endif // MAINWINDOW_H
